<?php

namespace App\Http\Requests\Api;

use Illuminate\Foundation\Http\FormRequest;


class LoginIndexRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'mobile' => 'required|exists:users,mobile'
        ];
    }

    public function messages()
    {
        return [
            'mobile.required' => '手机号必须填写',
            'mobile.exists' => '手机号不存在'
        ];
    }
}
